package com.itheima.exception;

import com.itheima.entity.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler
    public Result doException(Exception ex){
        System.out.println(ex.getMessage());
        return Result.error("出错了，请联系管理员");
    }
}
